/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package thinkinginjava.svn.strings.regularexpressions;

import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

/**
 *
 * @author public_enemy
 */
public class ReplacingStringTokenizer {

    public static void main(String[] args) {
        String input = "But I'm not dead! I feel happy!";

        StringTokenizer stoke = new StringTokenizer(input);

        while (stoke.hasMoreElements()) {
            System.out.print(stoke.nextToken() + " ");
        }
        System.out.println();

        System.out.println(Arrays.toString(input.split(" ")));

        Scanner scanner = new Scanner(input);

        while (scanner.hasNext()) {
            System.out.print(scanner.next() + " ");
        }


    }
}
